<script setup>

import {RouterView } from 'vue-router'
import {nextTick,provide, ref} from "vue";
import router from "@/router";

const isRouterAlive = ref(true)

// 让页面在不刷新的情况下 重新渲染一次 先消失再出现
const reload = () => {
  isRouterAlive.value = false
  nextTick(() => {
    isRouterAlive.value = true
  })
}
provide('reload', reload)

</script>

<template>
  <RouterView :key="router.currentRoute.value.fullPath + Math.random()" v-if="isRouterAlive" />
</template>
